home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / CKIT210.ARJ / CKITDEMO.H < prev    next >
C/C++ Source or Header  |  1991-12-22  |  7KB  |  150 lines

  1. /****************************************************************************
  2.  *   FILE CKITDEMO.H                                                        *
  3.  *   Created 11-FEB-1990            Rickie W. Belitz                        *
  4.  *                                  820 Brentwood Drive                     *
  5.  *                                  Maryville, Tennessee  37801             *
  6.  *                                  BBS (615) 982-6512                      *
  7.  *                                      (615) 982-6537                      *
  8.  *                                      (615) 982-8723                      *
  9.  *                                                                          *
  10.  *                  Parameters that are specific to CKITDEMO                *
  11.  *                                                                          *
  12.  ****************************************************************************/
  13.  
  14.  
  15. /****************************************************************************
  16.  *                   CKITDEMO macros                                        *
  17.  ****************************************************************************/
  18. #define     BELL   0x07
  19. #define     BUFFER_SIZE   2048  /* File Read Buffer */
  20.  
  21. /****************************************************************************
  22.  *      IF IF IF IF IF IF IF IF IF IF IF IF IF IF IF IF IF IF IF IF         *
  23.  ****************************************************************************/
  24. #if COMPILER == MICROSOFT
  25.     #define RAND( seed) (seed = ((( seed * 12) + 6) % (Modulo + 1)))
  26.     int     irandom(short);             /* Generate random number       */
  27.     #define dosopen _dos_open           /* MSC     */
  28.     #define dosread _dos_read
  29.     #define dosclose _dos_close
  30. #else
  31.     #define dosopen _open               /* Turbo C */
  32.     #define dosread _read
  33.     #define dosclose _close
  34. #endif
  35.  
  36. /****************************************************************************
  37.  *     ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF    *
  38.  ****************************************************************************/
  39.  
  40. /****************************************************************************
  41.  *                   CKITDEMO function prototypes                           *
  42.  ****************************************************************************/
  43. void    shut_down(void);      /* Shuts door down if normal or error occurs. */
  44. void    ansi_demo(void);            /* ANSI graphic demo            */
  45. void    display_info(void);         /* Display CKIT information     */
  46. void    take_chance(void);          /* Take a change game           */
  47. void    menu(void);                 /* Main menu for demo           */
  48. void    test_pattern(void);         /* Test pattern                 */
  49. void    filexfer(void);             /* Zmodem file xfer             */
  50. void    read_scancode(void);        /* Read key code                */
  51. void    print_msg(short, char **);  /* Print open_door errors       */
  52. void    send_byte(BYTE);            /* Send single byte out remote  */
  53. void    display_time(void);         /* Display XXXX used, XXXX left */
  54. char *  create_buffer(size_t);
  55. short   open_file(char *);
  56. size_t  ck_read_record(short, BYTE *, size_t);
  57. short   parse_to_C(char *, size_t, char **, short);
  58. void    copy_buffer(char *, char **, char *);
  59. short   read_WWIV(void);
  60.  
  61. /****************************************************************************
  62.  *     Set this array equal to your door program name desired               *
  63.  ****************************************************************************/
  64. char    progname[21] = "Ckit - Demo";   /* Program name for status line     */
  65.  
  66. /****************************************************************************
  67.  *     Used in filexfer() in ckitdemo.c                                     *
  68.  ****************************************************************************/
  69. char    doc_filename[9] ="CKIT.DOC";    /* Name for Zmodem xfer             */
  70. char    zmodem_cmds[256];               /* Buffer to build Zmodem command   */
  71. char    dszcmds[] = "port 2 pB4096 sz %s";
  72. char    dos_cmd[] = "COMSPEC";
  73.  
  74. /*****************************************************************************
  75.  *  Create array of pointers to our error messages                           *
  76.  *****************************************************************************/
  77. static  char    *ckit_errors[9] = {
  78. "Error opening system file -> ",
  79. "Error reading system file -> ",
  80. "Unknown BBS file type -> ",
  81. "Error opening users file -> ",
  82. "Invalid User Record in ->",
  83. "Error reading user record -> ",
  84. "Port syntax error: USAGE: PORT:AAAA:X AAAA=COMBASE X=IRQ",
  85. "Fossil driver not installed",
  86. "Unable to allocate memory",
  87.  };
  88.  
  89. /*****************************************************************************
  90.  *  If desired, optional custom log off messages.                            *
  91.  *  If not used, the library will use it's internal defaults.                *
  92.  *****************************************************************************/
  93. char    option0[] = "Normal Quit to BBS msg\n";
  94. char    option1[] = "CARRIER DROPPED! msg\n";
  95. char    option2[] = "Keyboard Timeout msg\n";
  96. char    option3[] = "Sysop return request msg\n";
  97. char    option4[] = "System time expired msg\n";
  98. char    option5[] = "Goobye, hangup msg\n";
  99.  
  100. /*****************************************************************************
  101.  *  If desired, optional general message used.                               *
  102.  *  If not used, the library will use it's internal defaults.                *
  103.  *****************************************************************************/
  104. char    ckmsg0[] = "Screen Display on Message";
  105. char    ckmsg1[] = "Time Adjusted due to event message";
  106. char    ckmsg2[] = "< Press ENTER to Continue > message";
  107. char    ckmsg3[] = "Sysop Chat Active Message";
  108. char    ckmsg4[] = "Sysop Chat End Message";
  109. char    ckmsg5[] = "Sysop Exited to DOS Message";
  110. char    ckmsg6[] = "Sysop Returned from DOS Message";
  111. char    ckmsg7[] = "(Enter=none)?) ";
  112. char    ckmsg8[] = "(Enter=yes) ";
  113. char    ckmsg9[] = "(Enter=no) ";
  114. char    ckmsg10[] = " (Enter) or (Y)es, (N)o, (NS)nonstop? ";
  115. char    ckmsg11[] = "More: ";
  116.  
  117. /*****************************************************************************
  118.  *  Create array of pointers to our custom log off messages                  *
  119.  *****************************************************************************/
  120. static  char    *logoffs[6] = {
  121.     option0,
  122.     option1,
  123.     option2,
  124.     option3,
  125.     option4,
  126.     option5,
  127. };
  128.  
  129. /*****************************************************************************
  130.  *  Create array of pointers to our custom general messages                  *
  131.  *****************************************************************************/
  132. static  char    *ckit_msgs[12] = {
  133.     ckmsg0,
  134.     ckmsg1,
  135.     ckmsg2,
  136.     ckmsg3,
  137.     ckmsg4,
  138.     ckmsg5,
  139.     ckmsg6,
  140.     ckmsg7,
  141.     ckmsg8,
  142.     ckmsg9,
  143.     ckmsg10,
  144.     ckmsg11
  145. };
  146.  
  147. /****************************************************************************
  148.  ************************ E N D  OF  M O D U L E ****************************/
  149.  
  150.